{% set listen_addresses=['127.0.0.1'] %}
{% set _ = listen_addresses.extend(rabbitmq_listen_addresses) %}
[
  {rabbit, [
    {loopback_users, []},
    {tcp_listeners, [ {% for listen_address in listen_addresses %}{"{{ listen_address }}", 5672}{% if not loop.last %}, {% endif %}{% endfor %} ]},
    {hipe_compile, true},
    {cluster_partition_handling, autoheal},
    {default_user, <<"admin">>},
    {default_pass, <<"{{ rabbitmq_password }}">>},
    {cluster_nodes, {
      [ {% for host in rabbitmq_hosts %}'rabbit@{{ host }}'{% if not loop.last %}, {% endif %}{% endfor %} ], disc}
    }
  ]},
  {rabbitmq_management, [{listener, [{port, 15672}, {ip, "{{ rabbitmq_listen_addresses[0] }}"}]}]}
].
